<?php 
$username = $this->session->userdata('username');
$password = $this->session->userdata('password');
if (empty($username) AND empty($password)){
	echo"..";
}else{
?>
<div id="wrappercontent">
	<div align="right">
		<a href="#karyawan_create" role="button" class="btn btn-danger" data-toggle="modal">Create</a>
	</div>	
	<div id="demo" style="margin-top:20px;">
	<table cellpadding="0" cellspacing="0" border="0" class="table table-hover"  style="font-size:12px; margin-bottom:20px;">
		<thead>
			<tr>
				<th>No</th>
				<th>NIP</th>
				<th>Nama</th>
				<th>Alamat</th>
				<th>No. Telp</th>
				<th>IP</th>
				<th>Departemen</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
		<?php $i = 1 ?>
		<?php foreach($karyawan as $data): ?>
		<tr>
			<td><?php echo $i++ ?></td>
			<td><?php echo $data->nip ?></td>
			<td><?php echo $data->nama_lengkap ?></td>
			<td><?php echo $data->alamat ?></td>
			<td><?php echo $data->noTelp ?></td>
			<td><?php echo $data->ip ?></td>
			<td><?php echo $data->nm_dept ?></td>
			<td>
			<div align="center">
				<?php echo anchor("login/form_update_karyawan/$data->nip", '<i class=icon-edit></i>'); ?> | 
				<?php echo anchor("login/delete_karyawan/$data->nip", '<i class=icon-trash></i>'); ?>
			</div>
			</td>
		</tr>
		<?php endforeach ?>
		</tbody>
	</table>
	</div>
</div>


<div id="karyawan_create" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-top:100px;">
	<?php echo form_open('login/create_karyawan');?>
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<div style="font-size:19px;">Create</div>
	</div>
	<div class="modal-body">
		<div class="row-fluid">
			<div class="span6">
			NIP
			<p style="margin-top:5px;"><input type="text" name="NIP"></p>
			Nama
			<p style="margin-top:5px;"><input type="text" name="Nama"></p>
			Alamat
			<p style="margin-top:5px;"><input type="text" name="Alamat"></p>
			</div>
			<div class="span6">
			No_telp
			<p style="margin-top:5px;"><input type="text" name="NoTelp"></p>
			IP
			<p style="margin-top:5px;"><input type="text" name="ip"></p>
			Departemen
			<p style="margin-top:5px;">		
			<select name="departemen">
				 <option value="0" selected>- Pilih Departemen -</option>
				 <?php foreach($departemen as $data): ?>
				 <option value=<?php echo $data->id_dept ?> ><?php echo $data->nm_dept ?></option>
				 <?php endforeach ?>
			</select>
			</p>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<input type="submit" value="save" class="btn btn-danger">
	</div>
	<?php echo form_close(); ?>
</div>
<?php
}
?>